/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:45 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class NhatkyhocEntity
    {
        public NhatkyhocEntity()
        {
			m_pk_inhatkyhocid=0;
			m_fk_ikhoahocid=0;
			m_fk_ibaihocid=0;
			m_dngayhoc=DateTime.Now;
			m_sghichu="";
        }
		private Int64 m_pk_inhatkyhocid;
		public Int64 PK_iNhatkyhocID
		{
			get { return m_pk_inhatkyhocid ; }
			set { m_pk_inhatkyhocid = value; }
		}
		private Int64 m_fk_ikhoahocid;
		public Int64 FK_iKhoahocID
		{
			get { return m_fk_ikhoahocid ; }
			set { m_fk_ikhoahocid = value; }
		}
		private Int64 m_fk_ibaihocid;
		public Int64 FK_iBaihocID
		{
			get { return m_fk_ibaihocid ; }
			set { m_fk_ibaihocid = value; }
		}
		private DateTime m_dngayhoc;
		public DateTime dNgayhoc
		{
			get { return m_dngayhoc ; }
			set { m_dngayhoc = value; }
		}
		private String m_sghichu;
		public String sGhichu
		{
			get { return m_sghichu ; }
			set { m_sghichu = value; }
		}

        #region Comparison
        public static List<NhatkyhocEntity> Sort(List<NhatkyhocEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(NhatkyhocEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<NhatkyhocEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<NhatkyhocEntity> COMPARISON_PK_iNhatkyhocID
		{
			get
			{
				return delegate(NhatkyhocEntity entity,NhatkyhocEntity other)
				{
					return entity.PK_iNhatkyhocID.CompareTo(other.PK_iNhatkyhocID);
				};
			}
		}
		public static Comparison<NhatkyhocEntity> COMPARISON_FK_iKhoahocID
		{
			get
			{
				return delegate(NhatkyhocEntity entity,NhatkyhocEntity other)
				{
					return entity.FK_iKhoahocID.CompareTo(other.FK_iKhoahocID);
				};
			}
		}
		public static Comparison<NhatkyhocEntity> COMPARISON_FK_iBaihocID
		{
			get
			{
				return delegate(NhatkyhocEntity entity,NhatkyhocEntity other)
				{
					return entity.FK_iBaihocID.CompareTo(other.FK_iBaihocID);
				};
			}
		}
		public static Comparison<NhatkyhocEntity> COMPARISON_dNgayhoc
		{
			get
			{
				return delegate(NhatkyhocEntity entity,NhatkyhocEntity other)
				{
					return entity.dNgayhoc.CompareTo(other.dNgayhoc);
				};
			}
		}
		public static Comparison<NhatkyhocEntity> COMPARISON_sGhichu
		{
			get
			{
				return delegate(NhatkyhocEntity entity,NhatkyhocEntity other)
				{
					return entity.sGhichu.CompareTo(other.sGhichu);
				};
			}
		}
        #endregion
    }
}
